import 'package:wch/generated/json/base/json_convert_content.dart';
import 'package:wch/model/dcotor.dart';

DcotorModel $DcotorModelFromJson(Map<String, dynamic> json) {
  final DcotorModel dcotorModel = DcotorModel();
  final String? code = jsonConvert.convert<String>(json['code']);
  if (code != null) {
    dcotorModel.code = code;
  }
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    dcotorModel.msg = msg;
  }
  final DcotorModelData? data = jsonConvert.convert<DcotorModelData>(
      json['data']);
  if (data != null) {
    dcotorModel.data = data;
  }
  return dcotorModel;
}

Map<String, dynamic> $DcotorModelToJson(DcotorModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['code'] = entity.code;
  data['msg'] = entity.msg;
  data['data'] = entity.data?.toJson();
  return data;
}

extension DcotorModelExtension on DcotorModel {
  DcotorModel copyWith({
    String? code,
    String? msg,
    DcotorModelData? data,
  }) {
    return DcotorModel()
      ..code = code ?? this.code
      ..msg = msg ?? this.msg
      ..data = data ?? this.data;
  }
}

DcotorModelData $DcotorModelDataFromJson(Map<String, dynamic> json) {
  final DcotorModelData dcotorModelData = DcotorModelData();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    dcotorModelData.id = id;
  }
  final String? hospitalId = jsonConvert.convert<String>(json['hospitalId']);
  if (hospitalId != null) {
    dcotorModelData.hospitalId = hospitalId;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    dcotorModelData.name = name;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    dcotorModelData.mobile = mobile;
  }
  final String? department = jsonConvert.convert<String>(json['department']);
  if (department != null) {
    dcotorModelData.department = department;
  }
  final String? hospital = jsonConvert.convert<String>(json['hospital']);
  if (hospital != null) {
    dcotorModelData.hospital = hospital;
  }
  final String? sex = jsonConvert.convert<String>(json['sex']);
  if (sex != null) {
    dcotorModelData.sex = sex;
  }
  return dcotorModelData;
}

Map<String, dynamic> $DcotorModelDataToJson(DcotorModelData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['hospitalId'] = entity.hospitalId;
  data['name'] = entity.name;
  data['mobile'] = entity.mobile;
  data['department'] = entity.department;
  data['hospital'] = entity.hospital;
  data['sex'] = entity.sex;
  return data;
}

extension DcotorModelDataExtension on DcotorModelData {
  DcotorModelData copyWith({
    int? id,
    String? hospitalId,
    String? name,
    String? mobile,
    String? department,
    String? hospital,
    String? sex,
  }) {
    return DcotorModelData()
      ..id = id ?? this.id
      ..hospitalId = hospitalId ?? this.hospitalId
      ..name = name ?? this.name
      ..mobile = mobile ?? this.mobile
      ..department = department ?? this.department
      ..hospital = hospital ?? this.hospital
      ..sex = sex ?? this.sex;
  }
}